#ifndef __BUTTONS_READ_H__
#define __BUTTONS_READ_H__

#include <xqueue.h>
#include <xtask.h>
#include <rrcon.h>
#include "log.h"

namespace Group5 {
    using namespace kthrobot;

    typedef XQueue<int> ButtonsQueue;

    class ButtonsReader : public XTask {
    public:
        ButtonsReader();
        virtual ~ButtonsReader();

        void TaskCode();

        ButtonsQueue* get_queue() { return &buttons_queue_; }

        bool* WaitForButton();

        static const int LEFT_BUTTON = 0;
        static const int RIGHT_BUTTON = 1;
        static const int UP_BUTTON = 2;
        static const int DOWN_BUTTON = 3;
        static const int CENTER_BUTTON = 4;

    private:
        ButtonsQueue buttons_queue_;
        bool previous_state[5];
    };
};

#endif // __BUTTONS_READ_H__
